package com.px.project.module.it.controller;

import com.px.project.module.it.dto.ContrastMessageDto;
import com.px.project.module.it.dto.ContrastMessageQueryOneDto;
import com.px.project.module.it.service.IContrastMessageService;
import com.px.project.module.it.vo.ContrastMessageVo;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 智能排产》》进度管理》》人员对比提醒接口
 *
 * @author 品讯科技
 * @date 2024-08
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/it/contrast/message")
public class ContrastMessageController {

    private final IContrastMessageService contrastMessageService;

    /**
     * 新增
     *
     * @param contrastMessage 人员对比提醒
     * @return {@link Boolean} 状态标识
     */
    @PostMapping(value = "/add")
    public Boolean addBatch(@RequestBody @Validated ContrastMessageDto contrastMessage) {
        return this.contrastMessageService.saveOfOne(contrastMessage);
    }

    /**
     * 单个查询
     *
     * @param contrastMessageQueryOne 查询参数
     * @return {@link ContrastMessageVo} 人员对比提醒
     */
    @GetMapping(value = "/get")
    public ContrastMessageVo getOne(@Validated ContrastMessageQueryOneDto contrastMessageQueryOne) {
        return this.contrastMessageService.findInfoOne(contrastMessageQueryOne);
    }
}